<%--
  Created by IntelliJ IDEA.
  User: Joker
  Date: 2022/5/2
  Time: 22:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>水果管理</title>
    <style>
        table {
            margin: 200px auto;
            border-collapse: collapse;
        }
    </style>
</head>
<body>
<script src="/statics/js/jquery-1.8.0.min.js"></script>
<script>
    function Delete(id) {
        var ret = confirm("确定要删除？");

        if (ret) {
            location.href = "${pageContext.request.contextPath}/del/" + id;
        }
    }
</script>
<table border="1px">
    <tr style="text-align: center">
        <th>类别</th>
        <th>品种</th>
        <th>产地</th>
        <th>总重量（公斤）</th>
        <th>单价（元/公斤）</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${list}" var="tmp">
        <tr>
            <td>${tmp.type}</td>
            <td>${tmp.breed}</td>
            <td>${tmp.area}</td>
            <td>${tmp.weight}</td>
            <td>${tmp.price}</td>
            <td>
                <a href="${pageContext.request.contextPath}/select/${tmp.fruitId}">详情</a>
                <a href="javascript:void(0)" onclick="Delete(${tmp.fruitId})">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
